﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace ZLDC.Estate.TM
{
    public partial class EstateDetail_1 : System.Web.UI.Page
    {
        string roomnoid = "0";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["roomnoid"] != null)
            {
                roomnoid = Request.QueryString["roomnoid"].ToString();
                if (!IsPostBack)
                {
                   GetModel(roomnoid);
                }
            }
          
        }
        protected void GetModel(string roomnoid) {
            ZLDC.Topo.BLL.Estate.RoomNoBLL bll = new ZLDC.Topo.BLL.Estate.RoomNoBLL();
            ZLDC.Topo.Model.Estate.RoomnoInfo model = new ZLDC.Topo.Model.Estate.RoomnoInfo();
            DataSet ds = ZLDC.DAL.Estate.RoomNoDAL.GetDatable(roomnoid);
            txtfloor.Value = ds.Tables[0].Rows[0]["floor"].ToString();
            txtname.Value = ds.Tables[0].Rows[0]["name"].ToString();
            txtbname.Value = ds.Tables[0].Rows[0]["bname"].ToString();
        }

        protected void btnadd_Click(object sender, EventArgs e)
        {
            ZLDC.DAL.Estate.RoomNoDAL dal = new ZLDC.DAL.Estate.RoomNoDAL();
            dal.UpdateRoomnoname(txtname.Value, roomnoid);
            Response.Write("<script>alert('修改成功!');parent.showT_roomno(1);parent.ClosePop();</script>");
        }
    }
}
